<?php
namespace BP\Sys;

use BP\En\EntityMyPK;

require_once("BP/En/Map.php");
class FrmImg extends EntityMyPK {
	public function getName () 
	{
		return $this->GetValStringByKey(FrmImgAttr::$Name);
	}
	public function setName ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$Name, $value);
	}
	public function getKeyOfEn () 
	{
		return $this->GetValStringByKey(MapAttrAttr::$KeyOfEn);
	}
	public function setKeyOfEn ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$KeyOfEn, $value);
	}
	public function getEnPK () 
	{
		return $this->GetValStringByKey(FrmImgAttr::$EnPK);
	}
	public function setEnPK ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$EnPK, $value);
	}
	public function getIsEdit () 
	{
		return $this->GetValIntByKey(FrmImgAttr::$IsEdit);
	}
	public function setIsEdit ($value) // [int value]
	{
		$this->SetValByKey(FrmImgAttr::$IsEdit, $value);
	}
	public function getHisImgAppType () 
	{
		return ImgAppType->forValue($this->GetValIntByKey(FrmImgAttr::$ImgAppType));
	}
	public function setHisImgAppType ($value) // [ImgAppType value]
	{
		$this->SetValByKey(FrmImgAttr::$ImgAppType, $value->getValue());
	}
	public function getImgSrcType () 
	{
		return $this->GetValIntByKey(FrmImgAttr::$ImgSrcType);
	}
	public function setImgSrcType ($value) // [int value]
	{
		$this->SetValByKey(FrmImgAttr::$ImgSrcType, $value);
	}
	public function getTag0 () 
	{
		return $this->GetValStringByKey(FrmImgAttr::$Tag0);
	}
	public function setTag0 ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$Tag0, $value);
	}
	public function getLinkTarget () 
	{
		return $this->GetValStringByKey(FrmImgAttr::$LinkTarget);
	}
	public function setLinkTarget ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$LinkTarget, $value);
	}
	public function getLinkURL () 
	{
		return $this->GetValStringByKey(FrmImgAttr::$LinkURL);
	}
	public function setLinkURL ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$LinkURL, $value);
	}
	public function getImgPath () 
	{
		$src = $this->GetValStringByKey(FrmImgAttr::$ImgPath);
		if ($DataType->IsNullOrEmpty($src))
		{
			$src = (("DataUser/ICON/" . SystemConfig::getCustomerNo()) . "/LogBiger.png");
		}
		return $src;
	}
	public function setImgPath ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$ImgPath, $value);
	}
	public function getImgURL () 
	{
		$src = $this->GetValStringByKey(FrmImgAttr::$ImgURL);
		if (($DataType->IsNullOrEmpty($src) || $src->contains("component/Img")))
		{
			$src = (("DataUser/ICON/" . SystemConfig::getCustomerNo()) . "/LogBiger.png");
		}
		return $src;
	}
	public function setImgURL ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$ImgURL, $value);
	}
	public function getY () 
	{
		return $this->GetValFloatByKey(FrmImgAttr::$Y);
	}
	public function setY ($value) // [float value]
	{
		$this->SetValByKey(FrmImgAttr::$Y, $value);
	}
	public function getX () 
	{
		return $this->GetValFloatByKey(FrmImgAttr::$X);
	}
	public function setX ($value) // [float value]
	{
		$this->SetValByKey(FrmImgAttr::$X, $value);
	}
	public function getH () 
	{
		return $this->GetValFloatByKey(FrmImgAttr::$H);
	}
	public function setH ($value) // [float value]
	{
		$this->SetValByKey(FrmImgAttr::$H, $value);
	}
	public function getW () 
	{
		return $this->GetValFloatByKey(FrmImgAttr::$W);
	}
	public function setW ($value) // [float value]
	{
		$this->SetValByKey(FrmImgAttr::$W, $value);
	}
	public function getFK_MapData () 
	{
		return $this->GetValStrByKey(FrmImgAttr::$FK_MapData);
	}
	public function setFK_MapData ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAttr::$FK_MapData, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($mypk) // [String mypk]
	{
		$me = new self();
		$me->setMyPK($mypk);
		$me->Retrieve();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FrmImg", "图片");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->IndexField = FrmImgAttr::$FK_MapData;
		$map->AddMyPK();
		$map->AddTBString(FrmImgAttr::$FK_MapData, NULL, "FK_MapData",  TRUE ,  FALSE , 1, 100, 20);
		$map->AddTBString(MapAttrAttr::$KeyOfEn, NULL, "对应字段",  TRUE ,  FALSE , 1, 100, 20);
		$map->AddTBInt(FrmImgAttr::$ImgAppType, 0, "应用类型",  FALSE ,  FALSE );
		$map->AddTBFloat(FrmImgAttr::$X, 5, "X",  TRUE ,  FALSE );
		$map->AddTBFloat(FrmImgAttr::$Y, 5, "Y",  FALSE ,  FALSE );
		$map->AddTBFloat(FrmImgAttr::$H, 200, "H",  TRUE ,  FALSE );
		$map->AddTBFloat(FrmImgAttr::$W, 160, "W",  FALSE ,  FALSE );
		$map->AddTBString(FrmImgAttr::$ImgURL, NULL, "ImgURL",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(FrmImgAttr::$ImgPath, NULL, "ImgPath",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(FrmImgAttr::$LinkURL, NULL, "LinkURL",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(FrmImgAttr::$LinkTarget, "_blank", "LinkTarget",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(FrmImgAttr::$GUID, NULL, "GUID",  TRUE ,  FALSE , 0, 128, 20);
		$map->AddTBString(FrmImgAttr::$Tag0, NULL, "参数",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBInt(FrmImgAttr::$ImgSrcType, 0, "图片来源0=本地,1=URL",  TRUE ,  FALSE );
		$map->AddTBInt(FrmImgAttr::$IsEdit, 0, "是否可以编辑",  TRUE ,  FALSE );
		$map->AddTBString(FrmImgAttr::$Name, NULL, "中文名称",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBString(FrmImgAttr::$EnPK, NULL, "英文名称",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBInt(MapAttrAttr::$ColSpan, 0, "单元格数�?",  FALSE ,  TRUE );
		$map->AddTBInt(MapAttrAttr::$TextColSpan, 1, "文本单元格数�?",  FALSE ,  TRUE );
		$map->AddTBInt(MapAttrAttr::$RowSpan, 1, "行数",  FALSE ,  TRUE );
		$map->AddDDLSQL(MapAttrAttr::$GroupID, 0, "显示的分�?", FrmUI->MapAttrString->getSQLOfGroupAttr(),  TRUE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function beforeInsert () 
	{
		if (($DataType->IsNullOrEmpty($this->getKeyOfEn()) ==  FALSE ))
		{
			$this->setMyPK((($this->getFK_MapData() . "_") . $this->getKeyOfEn()));
		}
		return parent->beforeInsert();
	}
	public function IsExitGenerPK () 
	{
		$sql = ((((("SELECT COUNT(*) FROM Sys_FrmImg WHERE FK_MapData='" . $this->getFK_MapData()) . "' AND X=") . $this->getX()) . " AND Y=") . $this->getY());
		if ((DBAccess->RunSQLReturnValInt($sql, 0) == 0))
		{
			return  FALSE ;
		}
		return  TRUE ;
	}
}
?>
